package com.bluefox.hospital.model;


import com.bluefox.jpa.model.AbstractAuditModel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * @author Administrator
 */
@Entity
@Getter
@Setter
@ToString
public class Doctor extends AbstractAuditModel {

    /**
     * 头像照片
     */

    private String photo;

    /**
     * 姓名
     */
    private String name;

    /**
     * 部门
     */
    @ManyToOne(cascade={CascadeType.MERGE,CascadeType.REFRESH},optional=false)//可选属性optional=false,表示department不能为空
    @JoinColumn(name="departmentId")//设置在employee表中的关联字段(外键)，另注意因为这里已经写了company_id,所以员工类不用在写companyId这个属性
    @JsonIgnoreProperties({"doctors"})
    private Department department;

    /**
     * 部门名称
     */
    private String departmentName;

    /**
     * 研究方向
     */
    private String research;

    /**
     * 简介
     */
    private String introduce;
    /**
     * 职称
     */
    private String title;
    /**
     * 是否是知名专家
     */
    private Integer isFamousExpert;


}
